package com.global.vo;

/**
 * 用于返回 boolean-String 对
 * @author zly601436
 *
 */
public class BooleanResult {

	private boolean result;
	private String message;

	public BooleanResult(boolean result){
		this.result = result;
		this.message = "";
	}
	
	public BooleanResult(boolean result, String message){
		this.result = result;
		this.message = message;
	}
	
	public boolean getResult() {
		return result;
	}
	public void setResult(boolean result) {
		this.result = result;
	}

	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((message == null) ? 0 : message.hashCode());
		result = prime * result + (this.result ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BooleanResult other = (BooleanResult) obj;
		if (message == null) {
			if (other.message != null)
				return false;
		} else if (!message.equals(other.message))
			return false;
		if (result != other.result)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "BooleanResult [result=" + result + ", message=" + message + "]";
	}
}
